API: Fix prop=revisions&rvdiffto= without rvprop=content
authorBrad Jorsch <bjorsch@wikimedia.org>
Fri, 2 May 2014 14:41:25 +0000 (10:41 -0400)
committerBrad Jorsch <bjorsch@wikimedia.org>
Fri, 2 May 2014 14:41:25 +0000 (10:41 -0400)
Make sure $this->section is initialized (and other stuff is checked)
when rvdiffto is used.

Bug: 64744
Change-Id: Ie6c50ad946ed5150819d004dabfe898a131a0a07

includes/api/ApiQueryRevisions.php

index 6150995..41bc8d4 100644 (file)
@@ -209,7 +209,7 @@ class ApiQueryRevisions extends ApiQueryBase {
                        $this->addWhereFld( 'ct_tag', $params['tag'] );
                }
 
-               if ( isset( $prop['content'] ) || !is_null( $this->difftotext ) ) {
+               if ( isset( $prop['content'] ) || !is_null( $this->diffto ) || !is_null( $this->difftotext ) ) {
                        // For each page we will request, the user must have read rights for that page
                        $user = $this->getUser();
                        /** @var $title Title */